 package com.farm.resume.service.impl;
 
 import com.farm.core.auth.domain.LoginUser;
 import com.farm.core.sql.query.DataQuery;
 import com.farm.core.time.TimeTool;
 import com.farm.resume.dao.ResumeeducateDaoInter;
 import com.farm.resume.domain.Resumeeducate;
 import com.farm.resume.service.ResumeeducateServiceInter;
 import java.util.List;
 import javax.annotation.Resource;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 
 
 
 
 
 
 
 
 
 
 
 @Service
 public class ResumeeducateServiceImpl
   implements ResumeeducateServiceInter
 {
   @Resource
   private ResumeeducateDaoInter resumeeducateDaoImpl;
   private static final Logger log = Logger.getLogger(ResumeeducateServiceImpl.class);
   
   @Transactional
   public Resumeeducate insertResumeeducateEntity(Resumeeducate entity, LoginUser user)
   {
     entity.setCuser(user.getId());
     entity.setCtime(TimeTool.getTimeDate14());
     entity.setCusername(user.getName());
     entity.setEuser(user.getId());
     entity.setEusername(user.getName());
     entity.setEtime(TimeTool.getTimeDate14());
     entity.setPstate("1");
     return this.resumeeducateDaoImpl.insertEntity(entity);
   }
   
   @Transactional
   public Resumeeducate editResumeeducateEntity(Resumeeducate entity, LoginUser user)
   {
     Resumeeducate entity2 = this.resumeeducateDaoImpl.getEntity(entity.getId());
     entity2.setEuser(user.getId());
     entity2.setEusername(user.getName());
     entity2.setEtime(TimeTool.getTimeDate14());
     entity2.setSchoolname(entity.getSchoolname());
     entity2.setUnitaryis(entity.getUnitaryis());
     entity2.setSpecialityname(entity.getSpecialityname());
     entity2.setDegree(entity.getDegree());
     entity2.setDateend(entity.getDateend());
     entity2.setDatetime(entity.getDatetime());
     entity2.setUserid(entity.getUserid());
     entity2.setPcontent(entity.getPcontent());
     this.resumeeducateDaoImpl.editEntity(entity2);
     return entity2;
   }
   
 
   @Transactional
   public void deleteResumeeducateEntity(String id, LoginUser user)
   {
     this.resumeeducateDaoImpl.deleteEntity(this.resumeeducateDaoImpl.getEntity(id));
   }
   
 
   @Transactional
   public Resumeeducate getResumeeducateEntity(String id)
   {
     if (id == null) {
       return null;
     }
     return this.resumeeducateDaoImpl.getEntity(id);
   }
   
 
   @Transactional
   public DataQuery createResumeeducateSimpleQuery(DataQuery query)
   {
     DataQuery dbQuery = DataQuery.init(query, "FARM_RESUME_EDUCATE", 
       "ID,SCHOOLNAME,UNITARYIS,SPECIALITYNAME,DEGREE,DATEEND,DATETIME,USERID,PCONTENT,PSTATE,EUSER,EUSERNAME,CUSER,CUSERNAME,ETIME,CTIME");
     return dbQuery;
   }
   
   public ResumeeducateDaoInter getResumeeducateDaoImpl()
   {
     return this.resumeeducateDaoImpl;
   }
   
   public void setResumeeducateDaoImpl(ResumeeducateDaoInter dao) {
     this.resumeeducateDaoImpl = dao;
   }
   
   @Transactional
   public List<Resumeeducate> getResumeeducateEntitysByUserId(String userid)
   {
     return this.resumeeducateDaoImpl.getResumeeducateEntitysByUserId(userid);
   }
 }
